package com.example.demo.mapper;

import com.example.demo.model.Contact;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: su
 * Date: 2023-04-08
 * Time: 14:36
 */
@Mapper
public interface ContactMapper {
    int insertContact (@Param("name") String name,
                @Param("email") String email,
                @Param("subject") String subject,
                @Param("message") String message
    );

    List<Contact> selectContact();

    List<Contact> selectContactByPageIndex(@Param("pageSize") Integer pageSize,
                                           @Param("offset") Integer offset);

    Contact selectContactById(@Param("id") Integer id);

    int deleteById(@Param("id") Integer id);
}
